package cn.bgs.mapper;

import cn.bgs.pojo.User;
import cn.bgs.vo.Bill;
import cn.bgs.vo.Residents;
import cn.bgs.vo.UserFile;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 用户/管理员表 Mapper 接口
 * </p>
 *
 * @author cf
 * @since 2022-06-07
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    User login(@Param("email") String email);

    Integer register(@Param("userEmail") String userEmail, @Param("password") String password);

    Integer updatePassword(Integer id, String email);

    void updatePwd(User user);

    void appUserInfo(UserFile userFile);

    void appFileAdd(UserFile userFile);

    User getUser(String userId);

    //新建报修记录时查询用户列表
    List<User> intoFind(String relationShip);

    List<Residents> findResidents(@Param("type") String type, @Param("name") String name);

    Integer delResidents(Integer id);

    Integer delcellIntermediate(Integer id);

    Integer countResidents();

    Integer updateResident(Residents residents);

    Integer updateFile(@Param("id") Integer id, @Param("type") String type, @Param("fileUrl") String fileUrl);

    Integer updateMiddle(@Param("id") Integer id, @Param("middle") String middle);

    Integer updateAudit(@Param("id") Integer id, @Param("audit") String Audit);
}
